package com.arofoxmsn.model.location;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;

import com.arofoxmsn.model.User;

@Embeddable
public class FavoriteLocation implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@Column(name = "user_id", nullable = false )
	private User owner;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@Column(name = "location_id", nullable = false )
	private Location location;
	
	private Calendar createdAt;
	
	private Calendar takedAt;
	
	public FavoriteLocation(User owner, Location location) {
		super();
		this.owner = owner;
		this.location = location;
	}
	
	public FavoriteLocation(){
		super();
	}
	
	public User getOwner() {return owner;}
	public void setOwner(User owner) {this.owner = owner;}
	
	public Location getLocation() {return location;}
	public void setLocation(Location location) {this.location = location;}
	
	public Calendar getCreatedAt() {return createdAt;}
	public void setCreatedAt(Calendar createdAt) {this.createdAt = createdAt;}
	
	public Calendar getTakedAt() {return takedAt;}
	public void setTakedAt(Calendar takedAt) {this.takedAt = takedAt;}
	
}
